<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>vue循环</p>
        <ul>
            <li v-for="item in lists">{{item}}</li>
        </ul>


        <ul>
            <li v-for="(item,index) in lists">{{item}}-----{{index}}</li>
        </ul>

        <ul>
            <li v-for="item in num">{{item}}</li>
            <!-- 从1 循环到  6 -->
        </ul>


        <ul>
            <li v-for="item in str">{{item}}</li>
        </ul>

        <ul>
            <li v-for="item in cart">{{item.id}} --- {{item.name}}</li>
        </ul>
    </div>
    <script src="./node_modules/vue/dist/vue.global.js"></script>
    <script>
        // const cart = [{id:1,name:''},{id:2,name:''},{id:3,name:''}]
        const {createApp} = Vue;

        createApp({
            data(){
                return {
                    lists:[100,200,300,400,500,600],
                    num:6,
                    str:'hello world',
                    cart: [{id:1,name:'asdf'},{id:2,name:'点我'},{id:3,name:'嗯嗯'}]
                }
            }
        }).mount('#app')

    </script>
</body>
</html>